package com.hgw.Demo05_MediatorPattern.MediatorPattern;

import java.util.ArrayList;

/**
 * Data time:2021/12/18 17:08
 * StudentID:2019112118
 * Author:hgw
 * Description: 抽象中介者
 */
public abstract class Mediator {
    protected ArrayList<Colleague> colleagues = new ArrayList<Colleague>(); // 用于存储同事对象

    // 注册方法，用于增加同事对象
    public void register(Colleague colleague) {
        colleagues.add(colleague);
    }

    // 声明抽象的业务方法
    public abstract void operation();
}
